package co.rcantor.dev.formularios;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

public class FormulariosActivity  extends TabActivity {
    
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.main);

	    Resources res = getResources(); // Resource object to get Drawables
	    TabHost tabHost = getTabHost();  // The activity TabHost
	    TabHost.TabSpec spec;  // Resusable TabSpec for each tab
	    Intent intent;  // Reusable Intent for each tab

	    // Create an Intent to launch an Activity for the tab (to be reused)
	    intent = new Intent().setClass(this, Registro.class);

	    // Initialize a TabSpec for each tab and add it to the TabHost
	    spec = tabHost.newTabSpec("datos1").setIndicator("Datos 1",
	                      res.getDrawable(R.drawable.ic_tab_registro))
	                  .setContent(intent);
	    tabHost.addTab(spec);

	    // Do the same for the other tabs
	    
	    intent = new Intent().setClass(this, DatosFinales.class);
	    spec = tabHost.newTabSpec("datos3").setIndicator("Datos 2",
	                      res.getDrawable(R.drawable.ic_tab_datosf))
	                  .setContent(intent);
	    tabHost.addTab(spec);
	    
	    intent = new Intent().setClass(this, DatosIniciales.class);
	    spec = tabHost.newTabSpec("datos2").setIndicator("Datos 3",
	                      res.getDrawable(R.drawable.ic_tab_datosi))
	                  .setContent(intent);
	    tabHost.addTab(spec);
	    
	    intent = new Intent().setClass(this, Resultados.class);
	    spec = tabHost.newTabSpec("resultados").setIndicator("Resultados",
	                      res.getDrawable(R.drawable.ic_tab_resultados))
	                  .setContent(intent);
	    tabHost.addTab(spec);

	}
	
}
